package com.xyzwps.mvckotlin.handler.helper

import org.springframework.http.MediaType
import org.springframework.web.reactive.function.BodyInserters
import org.springframework.web.reactive.function.server.ServerResponse


fun ServerResponse.BodyBuilder.json() = this.contentType(MediaType.APPLICATION_JSON)

fun <T> ServerResponse.BodyBuilder.bodyFromObject(t: T) = this.body(BodyInserters.fromObject(t))